Skip to content

fix: hold gateway socket in memory - hibernation is incoming-only - #11

Merged
JordanNewell merged 1 commit into
mainfrom
fix/no-hibernation
Dec 3, 2026
Merged

JordanNewell merged 1 commit into
mainfrom
fix/no-hibernation

Conversation

@JordanNewell

Copy link
Copy Markdown
Contributor

ROOT CAUSE of the never-green dot, caught live via wrangler tail: every cron tick throws Cannot call acceptWebSocket() on this WebSocket because its pair has already been accepted or used in a Response. Cloudflare's WebSocket Hibernation API only accepts incoming WebSocketPair server-sides — the outbound client socket this DO creates can never be accepted, so no gateway session ever opened. Rework: socket held in-memory (handlers attached directly), DO resident while open, cron reconnects from a fresh isolate after any eviction; alarm-driven heartbeats + zombie/missed-ack/send-fail guards unchanged. Protocol logic (HELLO/IDENTIFY/ACK/backoff/fatal codes) untouched; 25/25 tests green.

@JordanNewell
JordanNewell merged commit 09808ba into main Dec 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant